﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hydrogen.MathExt.Expression
{
    public enum TokenType
    {
        Number,
        Constant,
        Variable,
        Function,
        Operator,
        LeftParenthesis,
        RightParenthesis,
        Comma
    }
    /// <summary>
    /// 表示表达式中的基本元素
    /// </summary>
    public class Token
    {
        public TokenType Type { get; }
        public string Value { get; }
        public double? NumericValue { get; }

        public Token(TokenType type, string value, double? numericValue = null)
        {
            Type = type;
            Value = value;
            NumericValue = numericValue;
        }

        public override string ToString() => $"{Type}: {Value}";
    }
}
